home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 4191 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.5 KB

  1. Path: news.clark.net!usenet
  2. From: gusty@clark.net (Harlan Messinger)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: class INTERFACE declaration ??
  5. Date: Sun, 28 Jan 1996 19:39:06 GMT
  6. Organization: Clark Internet Services, Inc.
  7. Message-ID: <4egjeh$j3f@clarknet.clark.net>
  8. References: <310C267F.78BC@pi.net>
  9. NNTP-Posting-Host: gusty-ppp.clark.net
  10. Mime-Version: 1.0
  11. Content-Type: TEXT/PLAIN; charset=ISO-8859-1
  12. Content-Transfer-Encoding: 8bit
  13. X-Newsreader: Forte Free Agent 1.0.82
  14.  
  15. heggie <heggie@pi.net> wrote:
  16.  
  17. >I'm trying to implement a Date class who exists
  18. >of three int fields and some interfaces, with the
  19. >last thing i'm having some problems
  20. >(ps using borlands c++ for windows)
  21. >I can't think of a reason why the interface declaration
  22. >of setdate is wrong, anybody outhere maybe????
  23.  
  24. >THANKs in advantage,
  25.  
  26. >#include <stdio.h>
  27. >#include <stdlib.h>
  28. >#include <string.h>
  29. >#include <iostream.h>
  30.  
  31. >class Date
  32. >{
  33. >    public:
  34. >        void setdate (int d, int m, int y);
  35. >        void printdate ();
  36. >        void nextday();
  37.  
  38. >    private:
  39. >        int
  40. >            day,
  41. >            month,
  42. >            year;
  43. >}
  44.  
  45. The trouble is here. You need a semicolon after the closing brace of
  46. the class definition.
  47.  
  48. >void Date::setdate (int d, int m, int y)
  49. >{
  50. >.........
  51. >}
  52.  
  53. >************************************************
  54. >Compiling ..\SOURCES\OPDR_48.CPP:
  55. >Error ..\SOURCES\OPDR_48.CPP 21: Too many types in declaration
  56. >Error ..\SOURCES\OPDR_48.CPP 22: Type 'Date' may not be defined here
  57. >Error ..\SOURCES\OPDR_48.CPP 22: 'Date::setdate(int,int,int)' is not a 
  58. >member of 'Date'
  59.  
  60.  
  61.